<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>系统附件</title>
    <jsp:include page="/WEB-INF/view/commons/css.jsp" />
</head>
<body >
<div id="main-container" class="container-fluid">
    <form  action="sysattachment/${action eq "create" ?"save":"update"}" name="inputForm" id="inputForm" method="post" class="form-horizontal">
        <input name="id" id="id" value="${entity.id}" type="hidden" />


            <div class="form-group">
                <label class="col-sm-1 control-label">用户登录名：</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" name="title" value="${entity.title}" placeholder="用户登录名">
                </div>
                <label class="col-sm-1 control-label">原文件名：</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" name="oldName" value="${entity.oldName}" placeholder="原文件名">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-1 control-label">新文件名：</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" name="newName" value="${entity.newName}" placeholder="新文件名">
                </div>
                <label class="col-sm-1 control-label">路径：</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" name="path" value="${entity.path}" placeholder="路径">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-1 control-label">文件类型：</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" name="fileType" value="${entity.fileType}" placeholder="文件类型">
                </div>
                <label class="col-sm-1 control-label">模块：</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" name="moduleName" value="${entity.moduleName}" placeholder="模块">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-1 control-label">关联id：</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" name="refId" value="${entity.refId}" placeholder="关联id">
                </div>
                <label class="col-sm-1 control-label">关联id：</label>
                <div class="col-md-4">
                    <input type="text" class="form-control" name="refId" value="${entity.refId}" placeholder="关联id">
                </div>
            </div>
        <div class="form-group">
            <div class="col-sm-offset-1 col-sm-2">
                <button id="saveBtn" type="submit" class="btn btn-sm btn-primary"><i class="fa fa-floppy-o"></i> 提交</button>
                <button type="button" class="btn btn-sm link_close"><i class="fa fa-close"></i> 关闭</button>
            </div>
        </div>
    </form>
</div><!--/#main-container-->

<!-- script start -->
<jsp:include page="/WEB-INF/view/commons/js.jsp" />
<script type="text/javascript">
    $(document).ready(function(e) {
        var options = {
            rules:{
                title:{},
                oldName:{},
                newName:{},
                path:{},
                fileType:{},
                moduleName:{},
                refId:{}
            },
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    type:'post',
                    dataType:'json',
                    success:function(data){
                        if(data.success){
                            $('#searchBtn', parent.document).click();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        }else{
                            layer.alert(data.msg);
                        }
                    }
                });
            }
        };
        $("#inputForm").validate(options);
    });
</script>
<!-- script end -->
</body>
</html>
